package com.mce.nebula.entity;

import com.mce.nebula.common.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 企业实体，对应Python的Enterprise模型
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "enterprise_info",
       uniqueConstraints = @UniqueConstraint(columnNames = "enterprise_alias"))
public class Enterprise extends BaseEntity {
    
    @Column(name = "enterprise_id", length = 32, unique = true, nullable = false)
    private String enterpriseId;
    
    @Column(name = "enterprise_name", length = 64, nullable = false)
    private String enterpriseName;
    
    @Column(name = "enterprise_alias", length = 64, unique = true, nullable = false)
    private String enterpriseAlias;
    
    @Column(name = "is_active", nullable = false)
    private Boolean isActive = true;
    
    @Column(name = "enterprise_token", length = 128, unique = true)
    private String enterpriseToken;
    
    @Column(name = "logo", length = 2048)
    private String logo;
    
    @Column(name = "favicon", length = 2048)
    private String favicon;
    
    @Column(name = "document", length = 2048)
    private String document;
    
    @Column(name = "header_color", length = 32)
    private String headerColor;
    
    @Column(name = "header_writing_color", length = 32)
    private String headerWritingColor;
    
    @Column(name = "sidebar_color", length = 32)
    private String sidebarColor;
    
    @Column(name = "sidebar_writing_color", length = 32)
    private String sidebarWritingColor;
    
    @Column(name = "footer", length = 512)
    private String footer;
    
    @Column(name = "login_image", length = 2048)
    private String loginImage;
    
    @Column(name = "official_demo", length = 2048)
    private String officialDemo;
    
    @Column(name = "captcha_code", length = 64)
    private String captchaCode;
    
    @Override
    public String toString() {
        return this.enterpriseName;
    }
}